<template>
  <div class="message-box" v-if="visiable">
    <div class="inner">
      <div :class="['inner_title', initialData.type]">
        <header class="inner_title_head">{{initialData.title}}</header>
        <span class="inner_title_close" @click="hideMessageBox">X</span>
      </div>
      <div class="inner_content">{{initialData.content}}</div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'MessageBox',
}
</script>
<style lang="scss" scoped>
.message-box {
  width: 100%;
  height: 100%;
  background-color: rgba($color: #000000, $alpha: 0.5);
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  .inner {
    width: 500px;
    background-color: #ccc;
    border-radius: 5px;
    box-shadow: 1px 2px 3px #f40;
    &_title {
      font-size: 30px;
      font-weight: bolder;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 20px;
      height: 44px;
      line-height: 44px;
    }
    .info {
      background-color: blue;
    }
    .success {
      background-color: green;
    }
    .warn {
      background-color: orange;
    }
    .danger {
      background-color: red;
    }
    &_content {
      font-size: 20px;
      padding: 10px 20px;
    }
  }
}
</style>